package com.clq.test;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

import com.clq.annotate.Autowired2;
import com.clq.annotate.Controller2;
import com.clq.service.WWWService;

@Controller2("cat")
public class Cat {
	
	@Autowired2
	WWWService wService;
	
	public void say() {
		wService.test();
		System.out.println("i am a cat!");
	}
	
	public void say2() {
		System.out.println("i am a cat22222!");
	}
}

class MyInvocationHandler implements InvocationHandler{
	
	private Object proxy;
	
	public MyInvocationHandler(Object proxy) {
		this.proxy = proxy;
	}
	
	@Override
	public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
		method.invoke(this.proxy, args);
		return null;
	}
	
}

/*
class Icat extends Cat{
	Cat cat;
	
	Icat(Cat cat){
		this.cat = cat;
	}
	
	public void say() {
		System.out.println("hello who are you!");
		cat.say();
		System.out.println("END!!!");
	}
}*/
